{% extends "./layout.html" %}

{% block css %}
<link rel="stylesheet" href="/static/css/goodslist.css" />
{% endblock %}

{% block content %}
<div class="container">
    <a class="btn btn-success btn-block" href="/add-goods">新增商品</a>
    <table class="table">
        <tr>
            <th>商品编号</th>
            <th>商品名称</th>
            <th>商品价格</th>
            <th>操作</th>
        </tr>
        {% for item in goods %}
        <tr>
            <td data-goods="id">{{item._id.toString()}}</td>
            <td>{{item.goodsname}}</td>
            <td>{{item.price}}</td>
            <td>
                <input type="button" name="changegoods" class="btn btn-success" value="修改" />
                <input type="button" name="deletegoods" class="btn btn-danger" value="删除" />
            </td>
        </tr>
        {% endfor %}
    </table>
</div>

<div id="changealert">
    <h3 class="my-changetitle">修改商品</h3>
    <i class="close">×</i>
    <form class="my-form">
        <label class="my-label1">商品名称:</label>
        <input class="form-control my-changeform" type="text" name="changename" />
        <label class="my-label1">商品价格:</label>
        <input class="form-control my-changeform" type="number" name="changeprice" />
        <label class="my-label1">商品描述:</label>
        <input class="form-control my-changeform" type="text" name="changedes" />
        <input class="btn btn-success btn-block my-btn" name="change" type="submit" value="确认" />
        <input class="btn btn-danger btn-block my-btn" name="close" type="button" value="取消" />
    </form>
</div>
{% endblock %}

{% block js %}
<script src="/static/js/goodslist.js"></script>
{% endblock %}